
ADD_CUSTOM_COMMAND(OUTPUT	"${PROJECT_SOURCE_DIR}/libhooc/hcparser.tab.h"
							"${PROJECT_SOURCE_DIR}/libhooc/hcparser.tab.c"
	COMMAND bison "${PROJECT_SOURCE_DIR}/libhooc/hcparser.y"
	DEPENDS "${PROJECT_SOURCE_DIR}/libhooc/hcparser.y"
	WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/libhooc/")

ADD_CUSTOM_COMMAND(OUTPUT	"${PROJECT_SOURCE_DIR}/libhooc/hcscanner.c"
	COMMAND flex "${PROJECT_SOURCE_DIR}/libhooc/hcscanner.l"
	DEPENDS "${PROJECT_SOURCE_DIR}/libhooc/hcscanner.l"
	WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/libhooc/")

SET (libhooc_SOURCE
    hcsrcobj.h
    hcsrcobj.c
    hclist.h
    hclist.c
    hcstring.h
    hcstring.c
    hclog.h
    hclog.c
    hcparser.tab.h
    hcparser.tab.c
    hcscanner.c
    hccompiler.h
    hccompiler.c
    hcutil.h
    hcutil.c
    hccodenode.h
    hccodenode.c
    hcidnode.h
    hcidnode.c
    hcconstnode.h
    hcconstnode.c
    hcvardefnode.h
    hcvardefnode.c
    hcstrstream.h
    hcstrstream.c)
add_library(hooc ${libhooc_SOURCE})
